package com.bit.demo2;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2022-12-18
 * Time: 11:54
 */
interface IShape {
    void draw();
}

class Person implements IShape{

    private String name;
    private int age;

    @Override
    public void draw() {
        System.out.println(this.name + "正在吃豆子！");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
public class TestDemo {
    public static void main(String[] args) {
        System.out.println("请输入一个小数");
        Scanner scanner = new Scanner(System.in);
        float i = scanner.nextFloat();
        Person person = new Person();
        person.setName("caocao");
        person.setAge(12);
        person.toString();
        System.out.println(person);
    }
}
